package org.zero.concurrency.demo.example.mq;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: concurrency-demo
 * @description:
 * @author: 01
 * @create: 2018-10-22 20:24
 **/
@RestController
public class MqController {

    private final RabbitMqClient rabbitMqClient;

    @Autowired
    public MqController(RabbitMqClient rabbitMqClient) {
        this.rabbitMqClient = rabbitMqClient;
    }

    @GetMapping("/mq/send")
    public String send(@RequestParam("message") String message) {
        rabbitMqClient.sender(message);

        return "success";
    }
}
